package com.iwayin.core.utils.imagesearch;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class GImageSearch {

	public static void main(String[] args) throws IOException {
		URL url = new URL("https://ajax.googleapis.com/ajax/services/search/images?" + "v=1.0&q=linzhiling&userip=INSERT-USER-IP");
		URLConnection connection = url.openConnection();
		connection.addRequestProperty("Referer", "http://yoasking.com");

		String line;
		StringBuilder builder = new StringBuilder();
		BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
		while ((line = reader.readLine()) != null) {
			builder.append(line);
		}
		System.out.println(builder.toString());
	}
}
